<?php 
include TMPL_PATH.'public/header.phtml';
?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='javascript:;' class="on"><em>货币列表</em></a><span>|</span>
        <a href="javascript:add();">添加货币</a>
    </div>
</div>
<div class="pad_10">
<div class="table-list">
<table width="100%" cellspacing="0">
	<thead>
		<tr>
			<th width="50" align="center">序号</th>
			<th align="left">货币名称</th>
			<th width="15%" align="center">货币代码</th>
			<th width='10%' align="center">货币符号</th>
			<th width="10%" align="center">兑换汇率</th>
			<th width="10%" align="center">默认货币</th>
			<th width="10%" align="center">显示</th>
			<th width="15%" align="center">管理操作</th>
		</tr>
	</thead>
<tbody>
<?php 
$i=0;
if(isset($currencyList) && $currencyList):
	foreach ($currencyList as $v):
?>
	<tr>
		<td align="center"><?php echo $i++;?></td>
		<td><?php echo $v['fullname'];?></td>
		<td align="center"><?php echo $v['name'];?></td>
		<td align="center"><?php echo $v['symbol'];?></td>
		<td align="center"><?php echo $v['exchange'];?></td>
		<td align="center"><?php echo $v['isdefault'] ? '是' : '否';?></td>
		<td align="center"><?php if($v['visible']==1){?><font color="red">√</font><?php }else{?><font color="blue">×</font><?php }?></td>
		<td align="center" width="12%"><a href="javascript:;"
			onclick="edit('<?php echo $v['name'];?>', '<?php echo $v['fullname'];?>')" title="修改">修改</a> |  <a
			href='<?php echo U('site/currency_delete', 'name='. $v['name']);?>' onClick="return confirm('确认要删除 『 <?php echo $v['fullname'];?> 』 吗？')">删除</a> 
		</td>
	</tr>
<?php 
	endforeach;
endif;
?>
	</tbody>
</table>
</div>
</div>
</body>
<script type="text/javascript">
<!--
function add(){
	window.top.art.dialog({id:'add',iframe:'<?php echo U('site/currency_add')?>', title:'新增货币', width:'700', height:'450'}, function(){var d = window.top.art.dialog({id:'add'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'add'}).close()});void(0);
}
function edit(id, name) {
	window.top.art.dialog({id:'edit'}).close();
	window.top.art.dialog({title:'编辑货币',id:'edit',iframe:'<?php echo U('site/currency_edit');?>&name='+id,width:'700',height:'450'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
//-->
</script>
</html>